Skip to content

Bug: show_navigation_icon: false is filtered out in TopBar::toNativeProps() - #162

Merged
simonhamp merged 1 commit into
NativePHP:3.xfrom
JeremieMercier:patch-1
Aug 4, 2026
Merged

Bug: show_navigation_icon: false is filtered out in TopBar::toNativeProps()#162
simonhamp merged 1 commit into
NativePHP:3.xfrom
JeremieMercier:patch-1

Conversation

@JeremieMercier

@JeremieMercier JeremieMercier commented Jun 13, 2026

Copy link
Copy Markdown

The toNativeProps() method in TopBar uses array_filter with fn ($value) => $value !== null && $value !== false, which silently drops boolean false values before sending props to the native layer. This
makes it impossible to disable show_navigation_icon — the prop is never transmitted, so the native side always falls back to its default (showing the icon).

Fix: align the filter with SideNavHeader, which correctly uses fn ($value) => $value !== null.

// Before
], fn ($value) => $value !== null && $value !== false);

// After
], fn ($value) => $value !== null);

Reproducible with:

<native:top-bar title="Test" :show-navigation-icon="false" />
{{-- hamburger still visible despite false --}}

…rops()

The toNativeProps() method in TopBar uses array_filter with fn ($value) => $value !== null && $value !== false, which silently drops boolean false values before sending props to the native layer. This
  makes it impossible to disable show_navigation_icon — the prop is never transmitted, so the native side always falls back to its default (showing the icon).

 Fix: align the filter with SideNavHeader, which correctly uses fn ($value) => $value !== null.

  // Before
  ], fn ($value) => $value !== null && $value !== false);

  // After
  ], fn ($value) => $value !== null);

  Reproducible with:

  <native:top-bar title="Test" :show-navigation-icon="false" />
  {{-- hamburger still visible despite false --}}
@JeremieMercier JeremieMercier changed the title Bug: show_navigation_icon: false is filtered out in TopBar::toNativeP… Bug: show_navigation_icon: false is filtered out in TopBar::toNativeProps() Jun 13, 2026
@simonhamp

Copy link
Copy Markdown
Member

@JeremieMercier could you resolve the conflicts?

@JeremieMercier
JeremieMercier changed the base branch from main to 3.x July 31, 2026 20:46
@JeremieMercier

Copy link
Copy Markdown
Author

@simonhamp I modified the source branch because the TopBar.php file was removed in the main branch with version 4 of NativePHP.

@simonhamp

Copy link
Copy Markdown
Member

Thanks so much for the work you've put into this PR. Now that we're pushing towards fully native UI through SuperNative, PRs that target v3 or below should focus purely on bug fixes and security patches. So I'm going to close this one.

@simonhamp simonhamp closed this Aug 4, 2026
@simonhamp

Copy link
Copy Markdown
Member

Sorry, my bad. This is a bugfix

@simonhamp simonhamp reopened this Aug 4, 2026
@simonhamp
simonhamp merged commit e8ea898 into NativePHP:3.x Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants